package badgegenerator.model;

import java.util.ArrayList;
import java.util.List;

public class BadgeProject {
    private Integer id;
    private String title;
    private List<Employee> employeeList = new ArrayList<Employee>();
    private BadgePattern pattern;
    private String companyName;

    public BadgeProject(String title, String companyName) {
        this.title = title;
        this.companyName = companyName;
    }
    
    public BadgeProject() {
    }
    
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    
    public BadgeProject(BadgePattern pattern) {
        this.pattern = pattern;
    }

    public List<Employee> getEmployeeList() {
        return employeeList;
    }

    public void setEmployeeList(List<Employee> employeeList) {
        this.employeeList = employeeList;
    }

    public BadgePattern getPattern() {
        return pattern;
    }

    public void setPattern(BadgePattern pattern) {
        this.pattern = pattern;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("ID : ");
        builder.append(id);
        builder.append('\n');
        builder.append("Title : ");
        builder.append(title);
        builder.append('\n');
        builder.append("Company : ");
        builder.append(companyName);
        builder.append('\n');
        
        builder.append("Employees : ");
        builder.append('\n');
        for(Employee empl : employeeList){
            builder.append('\t');
            builder.append(empl);
            builder.append('\n');
        }
        
        return builder.toString();
    }

    @Override
    public int hashCode() {
        int hash = 7;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final BadgeProject other = (BadgeProject) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) {
            return false;
        }
        if (this.employeeList != other.employeeList && (this.employeeList == null || !this.employeeList.equals(other.employeeList))) {
            return false;
        }
        if (this.pattern != other.pattern && (this.pattern == null || !this.pattern.equals(other.pattern))) {
            return false;
        }
        if ((this.companyName == null) ? (other.companyName != null) : !this.companyName.equals(other.companyName)) {
            return false;
        }
        return true;
    }
}
